<%--
 *  File:    CarrierSelect.jsp
 *  @Author: Michael Zhao
 *  Date:    10/28/2002
 *
 *  Copyright (C) 2000 - 2002 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  
  String strTableName = "ovprivilegesummary";
  String strModuleName = "IMG";
  String privilegeCode = "Z0812";
%>





<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>




<html>
<head>
<title>Add</title>
<PageFlow:CheckPageFlow pageName="menuselect"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>

<%

  Vector menus = (Vector)pageContext.getAttribute("menusummary");
  if(menus == null)
  {
    menus = new Vector();
  }
 
 Integer app = (Integer)pageContext.getAttribute("app");
 Integer grade4rpt = (Integer)pageContext.getAttribute("grade4rpt");

%>

<script language="JavaScript">
function clickItem(id, code,name,grade,isbottom,module)
{
  document.frm.privilegeid.value = id;
  document.frm.prn.value = name;
  document.frm.privilegecode.value = code;
  document.frm.grade.value = grade;
  document.frm.isbottom.value = isbottom;
  document.frm.module.value = module;
 }

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(frm,actionvalue,orderbyname);
  editform.action = "MenuSelect.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}

function setParentValue()
{
  opener.page_setMenu(document.frm.privilegeid.value,document.frm.privilegecode.value,document.frm.prn.value,document.frm.grade.value,document.frm.isbottom.value,document.frm.module.value);
  window.close();
}


</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" cellpadding="0" height="100%">
<form name="frm" method="post">
    <input type="hidden" name="pagename" value="menuselect">
    <input type="hidden" name="actionname"> 
    <input type="hidden" name="app" value="<%=JspHelper.filterNull( app)%>">
	 <input type="hidden" name="grade4rpt" value="<%=JspHelper.filterNull( grade4rpt)%>">
      
    <tr> 
      <td valign="top"> 
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
          </tr>
        </table>
        <table width="100%" cellspacing="0" cellpadding="0">
         <%@ include file="/inc/SummarySearch.inc" %>
        </table> 
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
	  <tr class="deepblue-left"> 
        <td class="deepblue-left" width="26" >&nbsp;</td>
        <td class="td_center" width="106"><%= label.getLabelName("L_MenuCode") %></td>
        <td class="td_center" width="479"><%= label.getLabelName("L_MenuName") %></td>
       </tr>
	    <%
        int i = 0;
        String strIsChecked = new String("Checked");
        String strClassType = new String();   
        Integer nPrivilegeId = null;
        Integer nGrade = null;
        String strPrn = "";    
        String strPrivilegeCode = ""; 
		    String strIsbottom = "";
		    String strModule = "";
		
     %>
     <logic:iterate id="menu" collection="<%= menus %>">                      
      
     <%
       HashMap menuMap = (HashMap)pageContext.getAttribute("menu"); 
       if(i%2 == 1)
       {
         strClassType = "td-listrom";
       }else{                    
         strClassType = "";
       }
       if(i != 0)
       {          
         strIsChecked = "";
       }
       else
       {
         nPrivilegeId = (Integer)(menuMap.get("privilegeid"));
         strPrn = (String)(menuMap.get("prn"));  
         strPrivilegeCode = (String)(menuMap.get("privilegecode"));  
		     nGrade = (Integer)(menuMap.get("grade"));
		     strIsbottom = (String)(menuMap.get("isbottom"));
		     strModule = (String)(menuMap.get("module"));
       }  
       i++;        
     %>   
	 <tr onmouseover="this.className='tr-over'" 
         onmouseout="this.className='<%=JspHelper.filterNull(strClassType)%>'"
         class="<%=JspHelper.filterNull(strClassType)%>"  
         onClick="javascript:radiotrue('selectItem<%=JspHelper.filterNull( i )%>'); 
                             clickItem('<%=JspHelper.filterNull( menuMap.get("privilegeid") )%>', '<%=JspHelper.filterNull( menuMap.get("privilegecode") )%>','<%=JspHelper.filterNull( menuMap.get("prn") )%>','<%=JspHelper.filterNull( menuMap.get("grade") )%>','<%=JspHelper.filterNull( menuMap.get("isbottom") )%>','<%=JspHelper.filterNull( menuMap.get("module") )%>')">    
      <td> 
        <input id="selectItem<%=JspHelper.filterNull( i )%>" type="radio" name="selectMenu" class="normalradio"
               value="<%=JspHelper.filterNull( menuMap.get("privilegeid") )%>" <%=JspHelper.filterNull( strIsChecked )%>   onClick="javascript:clickItem('<%=JspHelper.filterNull(menuMap.get("privilegeid"))%>','<%=JspHelper.filterNull(menuMap.get("privilegecode"))%>', '<%=JspHelper.filterNull( menuMap.get("prn") )%>', '<%=JspHelper.filterNull( menuMap.get("grade") )%>', '<%=JspHelper.filterNull( menuMap.get("isbottom") )%>','<%=JspHelper.filterNull( menuMap.get("module") )%>')">
      </td>
      <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( menuMap.get("privilegecode") )%></td>
      <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( menuMap.get("prn") )%></td>
     </tr>
    </logic:iterate> 
	<input type="hidden" name="privilegeid" value="<%=JspHelper.filterNull( nPrivilegeId )%>"> 
    <input type="hidden" name="privilegecode" value="<%=JspHelper.filterNull( strPrivilegeCode )%>"> 
    <input type="hidden" name="prn" value="<%=JspHelper.filterNull( strPrn )%>"> 
	<input type="hidden" name="grade" value="<%=JspHelper.filterNull( nGrade )%>"> 
	<input type="hidden" name="isbottom" value="<%=JspHelper.filterNull( strIsbottom )%>">
	<input type="hidden" name="module" value="<%=JspHelper.filterNull( strModule )%>">  
	


         <%@ include file="/inc/SummaryActionPop.inc" %>
      </table>
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="summary_top"></td>
          </tr>
          <tr> 
            <td class="td_center">
			<a onclick="setParentValue()"><custom:button type="1" label="L_Confirm" imgsrc="Confirm.gif" border="0" style="width:60"/></a> 
			<a onclick="window.close()"><custom:button type="1" label="L_Cancel" imgsrc="cancel.gif" border="0" style="width:60"/></a>
			</td>
          </tr>
        </table>
      </td>
    </tr>
</table>
</form>
</table>
</body>
</html>



